//package com.lq.filestudy.controller;
//
//import com.alibaba.fastjson.JSON;
//
//import org.apache.tomcat.util.codec.binary.Base64;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import com.lq.filestudy.model.Result;
//import com.lq.filestudy.service.FileMangerService;
//import org.springframework.web.multipart.MultipartFile;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.nio.charset.StandardCharsets;
//import java.util.concurrent.ExecutionException;
//
//
//@RestController
//@RequestMapping("/file")
//public class FileMangerController {
//
//    @Resource
//    private   FileMangerService fileMangerService;
//
//
//    @GetMapping("/downLoad")
//    public void donloadFile( HttpServletResponse response){
//
//        String path = "/in/demo.jpg";
//        try {
//            fileMangerService.downLoad(path,response);
//        }catch (Exception e){
//            response.setHeader("res", Base64.encodeBase64String(JSON.toJSONString(Result.fail("下载文件发生异常")).getBytes(StandardCharsets.UTF_8)));
//        }
//    }
//
//    @PostMapping("/press")
//    public void downLoadPress(HttpServletResponse response, MultipartFile zipFile) throws IOException, ExecutionException, InterruptedException {
//      ///  String path = "C:\\data\\client\\2023\\黄靖文件学习\\合同资料\\黄靖A";
//        fileMangerService.press(zipFile,response);
//    }
//
//    @GetMapping("/unzip")
//    public void unzipPress(){
//        String zipPath = "F:\\file\\zip\\demoA.zip";
//        String  desDir= "F:\\file\\temp\\";
//        fileMangerService.unzipPress(zipPath,desDir);
//    }
//
//}
